package com.apes.fn.scm.advancePayment;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.apes.framework.query.ApesDao;
import org.springframework.stereotype.Component;

/**
 * @program: apes-server2
 * @description:
 * @author: czs
 * @create: 2023-10-07 10:50
 **/
@Component
public class AdvancePaymentDao extends ApesDao {


    public JSONArray findSourceType(JSONObject param) {
        StringBuffer sf = new StringBuffer();
        sf.append("select DISTINCT a.SOURCE_TYPE ID," +
                "decode(a.SOURCE_TYPE," +
                    "'refund','退订金'," +
                    "'forwardPay','提前收款生成订金'," +
                    "'refundToAdvance','冲红转订金'," +
                    "'useAdvance','用订金'," +
                    "a.SOURCE_TYPE)NAME\n" +
                "from Advance_Payment A\n" +
                "where SOURCE_TYPE is not null ");
        return toJSONArray(find(sf.toString(), param));

    }
}
